package com.cheer.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cheer.entity.OaMatrixClassEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 矩阵分类
 *
 * @author cheer
 */
@Mapper
@Repository
public interface OaMatrixClassDao extends BaseMapper<OaMatrixClassEntity> {

    default List<OaMatrixClassEntity> selectListByPid(Integer pid) {
        return selectList(new QueryWrapper<OaMatrixClassEntity>()
                .eq("pid", pid));
    }

    default IPage<OaMatrixClassEntity> selectPage(Integer pageNum, Integer pageSize) {
        return selectPage(new Page<>(pageNum, pageSize), Wrappers.emptyWrapper());
    }
}
